<include file="Public:header"/>

<div class="form_data">
	<form action="{:U('index',array('type'=>$type))}" method="get" filterValid="true" class="search_form">
	<div class="mod_name" id="no_pmb">
		<li <eq name="Think.ACTION_NAME" value="index">class="on"</eq>>
			<a href="{:U('index',array('type'=>$type))}">{$_cur_title}</a>
		</li>
		<li <eq name="Think.ACTION_NAME" value="recycle">class="on"</eq>>
			<a href="{:U('recycle', array('type'=>$type))}">回收站</a>
		</li>
	</div>
	<div class="mod_data" style="margin-bottom:10px;">
		<div class="input_data">
			{:W('Plugin/category_select', array('类别', 'category_id', $type, 0, 0, 0))}
			名称
			<input type="text" name="title" id="w100" value="{$title}">
			<button type="submit" class="btn btn-search">查询</button>
		</div>
	</div>
	</form>
</div>
<div class="data_list">
	<table>
		<tr>
			<th width="30"><input type="checkbox" onclick="$.checkbox(this,'.select-box')"></th>
			<th>类别</th>
			<th>标题</th>
			<th width="80">保存数量</th>
			<th width="80">下载数量</th>
			<th width="80">邮件数量</th>
			<th width="150">最后更新</th>
			<th width="80">排序</th>
			<th width="30" {:D('Role')->is_acl('checkbox?type=' . $type . '&field_name=status')}>启用</th>
			<th width="100">操作</th>
		</tr>
		<volist name="list" id="rs">
		<tr class="data-{$rs['id']}">
			<td class="select-box">
				<input type="checkbox" name="ids[]" value="{$rs['id']}">
				<input type="hidden" name="id[{$rs['id']}]" value="{$rs['id']}">
			</td>
			<td>{:D('Category')->get_name($rs['category_id'])}</td>
			<td style="text-align: left">{$rs['title']}</td>
			<td>{$rs['download_num']}</td>
			<td>{$rs['save_num']}</td>
			<td>{$rs['send_mail_num']}</td>
			<td>
				{:date('Y-m-d H:i:s', $rs['edit_time'])}
			</td>
			<td>
				<input class="w40 tac td-txt" type="text" name="order_id[{$rs['id']}]" value="<if condition="$rs['order_id'] neq '999999'">{$rs['order_id']}</if>">
			</td>
			<td {:D('Role')->is_acl('checkbox?type=' . $type . '&field_name=status')}>
				<input class="ajax_checkbox" url="{:URL('checkbox', array('type' => $type,'field_name'=>'status', 'id'=>$rs['id'],'name'=>'id'))}" type="checkbox" <eq name="rs.status" value="1">checked</eq> value="1" />
			</td>
			<td>
				<a href="{:URL('edit', array('type'=>$type, 'id'=>$rs['id']))}" title="修改">
					<i class="if if-edit"></i>
				</a>
				
				<a href="{:URL('del', array('type' => $type, 'id' => $rs['id']))}" class="btn-confirm-opt delete-opt" title="{$rs['title']}" del-class="data-{$rs['id']}">
					<i class="if if-delete"></i>
				</a>
			</td>
		</tr>
		</volist>
	</table>
</div>

<notempty name="page"><div class="page">{$page}</div></notempty>

<div class="batch_opt">
	<span class="btn btn-delete selected-delete" url="{:URL('del', array('type'=>$type))}">删除选中</span>
	<span class="btn btn-edit batch-edit">排序</span>
	<span class="btn btn-add" url="{:URL('add', array('type'=>$type))}">添加</span>
</div>

<include file="Public:footer"/>